package com.ruibang.glass.purchase.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruibang.glass.purchase.dto.FileInfoDTO;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 采购关联物品表
 * </p>
 *
 * @author mameng
 * @since 2024-03-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "采购到货关联物品表")
@TableName("g_purchase_arrival_product")
public class PurchaseArrivalProduct extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "序号")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "订单物品Id")
    private String orderItemId;

    @ApiModelProperty(value = "物料名称")
    private String itemName;

    @ApiModelProperty(value = "物料编码")
    private String itemCode;

    @ApiModelProperty(value = "物品Id")
    private String itemId;

    @ApiModelProperty(value = "到货Id")
    private String saleArrivalId;

    @ApiModelProperty(value = "规格型号")
    private String specificationModel;

    @ApiModelProperty(value = "数量")
    private Double quantity;

    @ApiModelProperty(value = "剩余到货数量")
    @TableField(exist = false)
    private Double surplusQuantity;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "含税单价")
    private BigDecimal taxInclusiveUnitPrice;

    @ApiModelProperty(value = "含税总价")
    private BigDecimal taxInclusiveTotalPrice;

    @ApiModelProperty(value = "税率")
    private BigDecimal taxRate;

    @ApiModelProperty(value = "不含税单价")
    private BigDecimal taxExclusiveUnitPrice;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "货币单位")
    private String currencyUnit;

    @ApiModelProperty(value = "入库数量")
    private Double warehousingQuantity;

    @ApiModelProperty(value = "批次号")
    private String pcNumber;

    @ApiModelProperty(value = "良品数")
    private Integer goodProduct;

    @ApiModelProperty(value = "不良品数")
    private Integer badProduct;

    @ApiModelProperty(value = "类型")
    private String itemType;

    @ApiModelProperty(value = "质检状态1_已质检")
    private Integer checkStatus;

    @ApiModelProperty(value = "1_已退货")
    private Integer backStatus;

    @ApiModelProperty(value = "仓库")
    private String warehouseName;

    @ApiModelProperty(value = "让步签收 1_未让步 2_让步")
    private String concessionAcceptance;

    @ApiModelProperty(value = "仓库编码")
    private String warehouseCode;

    @ApiModelProperty(value = "让步签收原因")
    private String concessionReason;

    @ApiModelProperty(value = "条形码编号")
    private String barcodeNumber;

    @TableField(exist = false)
    private List<String> fileIds;

    @TableField(exist = false)
    @ApiModelProperty(value = "合同附件")
    private List<FileInfoDTO> fileInfoDTOS;

    @ApiModelProperty(value = "供应商名称")
    @TableField(exist = false)
    private String supplierName;

    @ApiModelProperty(value = "供应商ID")
    @TableField(exist = false)
    private String supplierId;

    @ApiModelProperty(value = "物品入库审批状态")
    private String approveStatus;

    @ApiModelProperty(value = "入库Id")
    private String inventoryId;

    @ApiModelProperty(value = "入库编号")
    private String inventoryNumber;

    @ApiModelProperty(value = "1_已生成原材料验收单")
    private String useStatus;

    @ApiModelProperty(value = "含量(万分比)")
    private Double contentRatio;

    @ApiModelProperty(value = "冻结数量")
    private Integer forzenQuantity;

    @ApiModelProperty(value = "到货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime arrivalTime;
}
